<?php

class DataBase {
	
        var $connection;
	
	//Construtora
	function DataBase($banco) {
		$host = "localhost";
		$user = "root";
		$pass = "";
		$db = $banco;
                
		$this->connection($host, $user, $pass, $db);
		
	}
	
	//Iniciar conexão com o banco
	function connection($host, $user, $pass, $db) {
		$this->connection = mysql_connect($host, $user, $pass);
		if (!$this->connection) {
			return false;
		}
		
		mysql_select_db($db, $this->connection);
	}
	
	//Fechar conexão
	function closeConnection() {
		mysql_close($this->connection);
	}
	
}

?>